import 'package:bruno/bruno.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:whale/helper/component/component.dart';
import 'package:whale/helper/utils/util.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class ReportPage extends StatelessWidget {
  ReportPage({Key? key}) : super(key: key);
  final controller = Get.put(ReportController());
  final state = Get.find<ReportController>().state;
  // 主视图
  Widget _buildView() {
    return Column(
      children: [
        TPTabBar(
          controller: state.tabCtrl,
          height: 70.r,
          selectedStyle: TextStyle(
            color: ColorsUtil.theme,
            fontSize: 15.sp,
            fontWeight: FontWeight.bold,
          ),
          unSelectedStyle: TextStyle(
            color: ColorsUtil.content,
            fontSize: 15.sp,
          ),
          backgroundColor: Colors.white,
        ),
        Expanded(
          child: TPTabBarView(controller: state.tabCtrl, children: [
            noDataView(),
            noDataView(),
            noDataView(),
            // ReportContentView(),
            // ReportContentView(),
            // ReportContentView(),
          ]),
        )
      ],
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<ReportController>(
      builder: (_) {
        return Scaffold(
          appBar: detailAppBar(context,
              title: '报告',
              leadding: const SizedBox(),
              backgroundColor: Colors.white,
              titleColor: Colors.black,
              actions: [
                IconButton(
                    onPressed: () {
                      Get.toNamed(RouterPath.search,
                          arguments: '请输入关键字',
                          parameters: {
                            'reportType': '政策措施',
                          });
                    },
                    icon: const Icon(IconUtil.search,color: Colors.black,))
              ]),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
